<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('货物授权')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-supplier-grant">
            <input type="hidden" name="id"   th:value="*{id}" />
        <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
            <div class="panel panel-default" th:each="goodsType,goodsTypeStat : ${googsTypes}">
                <div class="panel-heading" role="tab" id="headingOne">
                    <h4 class="panel-title">
                        <a role="button" data-toggle="collapse" data-parent="#accordion" href="collapseone" aria-expanded="true" aria-controls="collapseone" th:text="*{goodsType.goodsClassificationName}"></a>
                    </h4>
                </div>
                <div id="collapseone" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
                    <div class="panel-body">
                        <div th:each="goods,goodsStat : ${goodsType.list}">
                            <input type="checkbox" name="grantGoods"   th:value="*{goods.goodsId}" /><span th:text="*{goods.goodsName}"></span>
                            <br/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        function submitHandler() {
//            var goods=[];
//            $("input[name='grantGoods']:checked").each(function(){
//                goods.push($(this).val());
//            })

            if ($.validate.form()) {
                $.operate.save("/system/suppliergoodsimplower/addpatch", $('#form-supplier-grant').serialize());
            }
        }
    </script>
</body>